package net.ch2.pc12.tech.ackborn.activity.thread;

import net.ch2.pc12.tech.ackborn.R;
import net.ch2.pc12.tech.ackborn.activity.TopActivity;
import net.ch2.pc12.tech.ackborn.dto.ProgressDTO;
import net.ch2.pc12.tech.ackborn.model.BbsModel;
import android.content.Context;
import android.os.Handler;

public class BoardListThread extends BaseThread {

	private boolean _forceReload;
	
	@Override
	public void exec() {
		TopActivity act = (TopActivity)listener;
		act.getProgressDTO().setProgressMessage(act.getString(R.string.Loading));
		act.run();
		BbsModel model = new BbsModel();
		model.load(_forceReload,(Context)listener);
		act.setModel(model);
		act.getProgressDTO().setProgressMessage(act.getString(R.string.LoadFinish));
		act.getProgressDTO().setProgress(ProgressDTO.COMPLETE);
	}
	
	public BoardListThread(Handler handler,Runnable listener,boolean forceReload){
		super(handler,listener);
		_forceReload = forceReload;
	}

}
